<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body" style="padding-top: 20px;height: 100%" id="media">

        <div class="layui-form-item">
            <label class="layui-form-label">学生(必须是已登录过小程序并且填写过真实姓名)</label>
            <div class="layui-input-block">
                <input name="user_id" required value="{$vo.user_id|default=''}" placeholder="请选择学生，必填"  class="layui-input selectpage" data-source="/admin/user/selectpage" data-where="role=1" data-field="realname">
            </div>
        </div>

        <div class="hr-line-dashed"></div>
        <div class="layui-form-item text-center">
            <!--{notempty name='vo.id'}-->
            <input type='hidden' value='{$vo.id}' name='id'>
            <!--{/notempty}-->
            <button class="layui-btn" type='submit'>保存数据</button>
            <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
        </div>
    </div>
</form>


{block name="script"}
<script>
    require(['layui'],function () {
        layui.use(['form','laydate','layer'],function() {
            window.form = layui.form;
            require(['form'], function () {
                apply('{$vo.is_hot|default="0"}');
                window.form.render();
                window.form.on('radio(bannertype)', function (data) {
                    apply(data.value);
                });
                function apply(value) {
                    $("[data-is_hot='" + value + "']").trigger('click');
                }
            })

        })
    });
    layui.use('laydate', function(){
        // var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#begin_time', //指定元素
            type: 'datetime'
        });
        laydate.render({
            elem: '#end_time', //指定元素
            type: 'datetime'
        });
    });
</script>
{/block}